package com.ironman.original.generator;


import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Component;

@Component
public class GpsOriginalDataGenerator extends OriginalDataGenerator {

    @Override
    public String dataType() {
        return "gps";
    }

    @Override
    public String generate() {
        return StrUtil.format("A,{},{},{},{}",
                NumberUtil.round(RandomUtil.randomDouble(121.005572, 121.010572), 6).doubleValue(),
                NumberUtil.round(RandomUtil.randomDouble(31.102556, 31.128556), 6).doubleValue(),
                NumberUtil.round(RandomUtil.randomDouble(100.0000, 200.9999), 4).doubleValue(),
                RandomUtil.randomInt(0, 359));
    }
}
